<html>
    <head>
        <title><?= $data['title'] ?></title>
        <link type="text/css" href="/admin/css/bootstrap.css" rel="stylesheet" />
        <link type="text/css" href="/admin/css/main.css" rel="stylesheet" />
        <script src="/admin/js/jquery-1.6.2.min.js"></script>
        <script src="/admin/js/jquery-ui-1.8.16.custom.min.js"></script>
        <script src="/admin/js/jquery.ui.nestedSortable.js"></script>

        <script src="/admin/js/bootstrap-alert.js"></script>
        <script src="/admin/js/bootstrap-button.js"></script>
        <script src="/admin/js/bootstrap-collapse.js"></script>
        <script src="/admin/js/bootstrap-dropdown.js"></script>
        <script src="/admin/js/bootstrap-modal.js"></script>
        <script src="/admin/js/bootstrap-tab.js"></script>
        <script src="/admin/js/bootstrap-tooltip.js"></script>
        <script src="/admin/js/bootstrap-typeahead.js"></script>
        <script src="/admin/js/ajax.js"></script>
        <script src="/admin/js/modal.js"></script>
        <style type="text/css">
            /* Override some defaults */
            html, body {
                background-color: #eee;
            }


            body {
                padding-top: 20px; /* 40px to make the container go all the way to the bottom of the topbar */
            }
            .container > footer p {
                text-align: center; /* center align it with the container */
            }
            .container {
                width: 940px; /* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
            }

            /* The white background content wrapper */
            .container > .content {
                background-color: #fff;
                padding: 20px;
                margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
                -webkit-border-radius: 0 0 6px 6px;
                -moz-border-radius: 0 0 6px 6px;
                border-radius: 0 0 6px 6px;
                -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
                -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
                box-shadow: 0 1px 2px rgba(0,0,0,.15);
            }

            /* Page header tweaks */
            .page-header {
                background-color: #f5f5f5;
                padding: 20px 20px 10px;
                margin: -20px -20px 20px;
            }

            /* Styles you shouldn't keep as they are for displaying this base example only */
            .content .span11,
            .content .span3 {
                min-height: 500px;
            }
            /* Give a quick and non-cross-browser friendly divider */
            .content .span3 {
                margin-left: 0;
                padding-left: 19px;
                border-left: 1px solid #eee;
            }

            .content .span11
            {
                border-left: 1px solid #eee;
            }

            .topbar .btn {
                border: 0;
            }

            .top-span
            {
                padding: 20px;
                padding-bottom: 5px;
                background-color: #f5f5f5;
                width: 739px;
            }

        </style>
    </head>
    <body>
        <div class="navbar navbar-fixed-top " data-dropdown="dropdown">
            <div class="navbar-inner">
                <div class="container">
                    <a class="brand" href="#">
                        QuickStudio
                    </a>
                    <ul class="nav">
                        <li class="dropdown">
                            <a href="#"
                               class="dropdown-toggle"
                               data-toggle="dropdown">
                                Меню
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="index.php?menu=def">def-menu</a>
                                </li>
                                <li>
                                    <a href="index.php?menu=news">news-menu</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#"
                               class="dropdown-toggle"
                               data-toggle="dropdown">
                                Разделы
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="entity.php?table=pages">Страницы</a>
                                </li>
                                <li>
                                    <a href="entity.php?table=news">Новости</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#"
                               class="dropdown-toggle"
                               data-toggle="dropdown">
                                Блоки
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="index.php?menu=def">Просмотреть</a>
                                </li>
                                <li>
                                    <a href="index.php?menu=news">Добавить</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#"
                               class="dropdown-toggle"
                               data-toggle="dropdown">
                                Модули
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="index.php?menu=def">Просмотреть</a>
                                </li>
                                <li>
                                    <a href="index.php?menu=news">Добавить</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#"
                               class="dropdown-toggle"
                               data-toggle="dropdown">
                                Настройки
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="settings.php">Главные настройки</a>
                                </li>
                                <li>
                                    <a href="#" data-controls-modal="my-modal" onclick="modalFromFile('ajax/addAdmin.php');">Добавить администратора</a>
                                </li>
                                <li>
                                    <a href="settings.php?act=list_admin">Просмотр администраторов</a>
                                </li>
                                <li>
                                    <a href="index.php?menu=news">Создание разделов</a>
                                </li>
                                <!--<li>
                                    <a href="index.php?menu=news">Настройки модулей</a>
                                    <ul>
                                        <li> <a href="index.php?menu=news">Создание разделов</a></li>
                                        <li> <a href="index.php?menu=news">Создание разделов</a></li>
                                        <li> <a href="index.php?menu=news">Создание разделов</a></li>
                                        <li> <a href="index.php?menu=news">Создание разделов</a></li>
                                    </ul>
                                </li>-->
                                <li>
                                    <a href="index.php?menu=news">Настройки статистики</a>
                                </li>
                                <li>
                                    <a href="index.php?menu=news">Добавить</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#"
                               class="dropdown-toggle"
                               data-toggle="dropdown">
                                Отчеты
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="index.php?menu=def">Просмотреть</a>
                                </li>
                                <li>
                                    <a href="index.php?menu=news">Очистить</a>
                                </li>
                                <li>
                                    <a href="index.php?menu=news">Настройки отчетов</a>
                                </li>
                                <li>
                                    <a href="index.php?menu=news">Статистика сайта</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="container">
            <div class="content">
                <div class="row">
                    <div class="span3">
                        <div class="small-head">
                            <h3>Навигация</h3>
                        </div>
                        <a href="index.php">Меню</a>
                        <h3>Разделы</h3>
                        <?php foreach ($data['entities'] as $ent): ?>
                            <a href="/admin/entity.php?table=<?= $ent['name'] ?>"><?= $ent['view_name'] ?></a><br />
                        <?php endforeach; ?>
                    </div>
                    <div class="span13">
                        <?= $content ?>
                    </div>
                </div>
            </div>
        </div>



        <?php
        $db = Db::getInstance();
        $db->debug();
        ?>
        <div id="my-modal" class="modal hide fade in"></div>
    </body>
</html>